package com.coder520.androidstudybroadcaster;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.support.v4.content.LocalBroadcastManager;

import com.coder520.androidstudybroadcaster.bean.User;

/**
 * Created by huang on 2017/7/4.
 */

public class UserBroadcastReceiver2 extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        String actionName = intent.getAction();
        switch (actionName) {
            case MainActivity.ACTION_BROADCAST_TEST:
                User user = intent.getParcelableExtra(MainActivity.EXTRA_USER);
                System.out.println("coder520....2222. user = " + user);
                setResultData("lao wang ...");
                abortBroadcast();

                break;
            default:
                break;
        }
    }
}
